package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.GetCodeBean;
import casa.depesos.app.com.http.data.Bank;
import casa.depesos.app.com.http.parser.GetCodeParser;

public class SaveCardReq implements HttpReq<GetCodeBean> {

    Map param;

    public SaveCardReq(Map map) {
        param = map;
    }

    @Override
    public void req(ReqCallback<GetCodeBean> callback) {//  /app/bindCard/saveCard
        req("/app/cardBinding/preserveCardDetails", new GetCodeParser(), callback);
    }

    @Override
    public Map getBody() {
        Map map = HttpReq.super.getBody();
        map.put("cref", param.get("number"));
        Bank tmp = (Bank) param.get("bank");
        map.put("bankID", tmp.code);
        map.put("bid", tmp.name);
        map.put("securityCode", param.get("code"));

        return map;
    }
}
